package com.jianbing.util;

import com.jianbing.entity.*;
import com.jianbing.entity.datacheck.ColumnCheckInfo;
import com.jianbing.entity.datacheck.DataCheckRule;

/**
 * Created by Han, Tixiang on 2016/11/10 0010.
 */
public class TableUtils {
	public static String prefix = "prod".equals(PropertiesUtils.getProperties("enviroment", "prod")) ? ""
			: PropertiesUtils.getProperties("enviroment", "prod") + "_";
	public static final String PROVINCE_TABLE = prefix + "province";// 省份
	public static final String NODE_TABLE = prefix + "node"; // 模拟器
	public static final String IDS_TABLE = prefix + "ids";// id自增

	public static final String IP_CHECKCITY_TABLE = prefix + "ip_check_city";// ip代理检查表
	public static final String IP_ACCESS_TABLE = prefix + "ip_access"; // ip白名单

	public static final String SHEBAO_CITY_TABLE = prefix + "city"; // 社保城市
	public static final String SHEBAO_TASK_TABLE = prefix + "shebao_task"; // 社保任务
	public static final String SHEBAO_YZM_TASK_TABLE = prefix + "shebao_yanzhengma_task"; // 社保验证码
	public static final String FAYUAN_TASK_TABLE = prefix + "fayuan_task"; // 法院任务表
	public static final String FAYUAN_DATA_TABLE = prefix + "fayuan_data";// 法院数据
	public static final String FAYUAN_CITY = prefix + "fayuan_city";// 法院城市配置表

	public static final String GJJ_CITY_TABLE = prefix + "gjj_city";// 公积金城市
	public static final String GJJ_TASK_TABLE = prefix + "gjj_task"; // 公积金任务
	public static final String GJJ_YZM_TASK_TABLE = prefix + "gjj_yzm_task"; // 公积金验证码

	public static final String GJJ_LOAN_CITY_TABLE = prefix + "gjj_loan_city"; // 公积金贷款城市
	public static final String GJJ_LOAN_TASK_TABLE = prefix + "gjj_loan_task"; // 公积金贷款
	public static final String GJJ_LOAN_YZM_TASK_TABLE = prefix + "gjj_loan_yzm_task"; // 公积金贷款验证码
	public static final String GJJ_LOGIN_PARAM_TABLE = "gjj_login_param"; // 公积金贷款验证码
	public static final String DATA_CHECK_RULE_TABLE = prefix + "data_check_rule";
	public static final String DATA_TEMPLATE_TABLE = prefix + "data_template";
	public static final String DATA_COMPARE_RESULT_TABLE = prefix + "data_compare_result";
	public static final String DATA_COLUMN_CHECK_INFO_TABLE = prefix + "data_column_check_info";
	public static final String SHEBAO_LOGIN_TIME_COUNT_TABLE = prefix + "shebao_login_time_count";
	

	public static String getTableName(Class clazz) {
		if (clazz == City.class) {
			return SHEBAO_CITY_TABLE;
		}

		if (clazz == DataCheckRule.class) {
			return DATA_CHECK_RULE_TABLE;
		}
		if (clazz == GjjLoginParam.class) {
			return GJJ_LOGIN_PARAM_TABLE;
		}

		if (clazz == Province.class) {
			return PROVINCE_TABLE;
		}

		if (clazz == GjjTask.class) {
			return GJJ_TASK_TABLE;
		}

		if (clazz == SheBaoTask.class) {
			return SHEBAO_TASK_TABLE;
		}

		if (clazz == GjjCodeTask.class) {
			return GJJ_YZM_TASK_TABLE;
		}

		if (clazz == ShebaoYanzhengmaTask.class) {
			return SHEBAO_YZM_TASK_TABLE;
		}

		if (clazz == IpCheckCity.class) {
			return IP_CHECKCITY_TABLE;
		}

		if (clazz == IpAccess.class) {
			return IP_ACCESS_TABLE;
		}

		if (clazz == Node.class) {
			return NODE_TABLE;
		}

		if (clazz == GjjCity.class) {
			return GJJ_CITY_TABLE;
		}

		if (clazz == GjjLoanCity.class) {
			return GJJ_LOAN_CITY_TABLE;
		}

		if (clazz == GjjLoanTask.class) {
			return GJJ_LOAN_TASK_TABLE;
		}

		if (clazz == GjjLoanCodeTask.class) {
			return GJJ_LOAN_YZM_TASK_TABLE;
		}

		if (clazz == DataTemplate.class) {
			return DATA_TEMPLATE_TABLE;
		}

		if (clazz == DataCompareResult.class) {
			return DATA_COMPARE_RESULT_TABLE;
		}
		if (clazz == FaYuanCity.class) {
			return FAYUAN_CITY;
		}
		if (clazz == FaYuanTask.class) {
			return FAYUAN_TASK_TABLE;
		}
		if (clazz == FaYuanData.class) {
			return FAYUAN_DATA_TABLE;
		}
		if (clazz == ColumnCheckInfo.class) {
			return DATA_COLUMN_CHECK_INFO_TABLE;
		}
		if (clazz == SheBaoLoginTimeCount.class) {
			return SHEBAO_LOGIN_TIME_COUNT_TABLE;
		}
		
		return "";

	}

	public static String getIdsTableName() {
		return IDS_TABLE;
	}
}
